<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <body>
        <ui:composition template="templateGeneral.xhtml">
            <ui:define name="title">Dodavanje zaposlenog</ui:define>
            <ui:define name="center">

                <h2 style="margin-left: 20px"><h:outputText value="Dodavanje zaposlenog" /></h2>
                <h:form>
                    <h:panelGrid columns="2" cellpadding="10">

                        <h:outputText value="Korisniko Ime " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.korisnik.korisnickoIme}" required="true" requiredMessage="Morate uneti korisnicko ime"/>

                        <h:outputText value="Lozinka " style="font-weight:bold"/>
                        <p:password   id="psw1" value="#{adminDodajOsobu.korisnik.lozinka}" match="psw2" required="true" requiredMessage="Morate uneti lozinku"/>

                        <h:outputText value="Ponovite lozinku " style="font-weight:bold"/>
                        <p:password   id="psw2" value="#{adminDodajOsobu.korisnik.lozinka}"  required="true" requiredMessage="Morate uneti lozinku"/>

                        <h:outputText value="Ime " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.korisnik.ime}" required="true" requiredMessage="Morate uneti indeks"/>

                        <h:outputText value="Prezime " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.korisnik.prezime}" required="true" requiredMessage="Morate uneti tip studija"/>

                        <h:outputText value="Adresa " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.zaposlen.adresa}" required="true" requiredMessage="Morate uneti ime"/>

                        <h:outputText value="Telefon " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.zaposlen.telefon}" required="true" requiredMessage="Morate uneti prezime"/>

                        <h:outputText value="Email " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.zaposlen.mail}" required="true" requiredMessage="Morate uneti adresu"/>

                        <h:outputText value="Web sajt " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.zaposlen.web}"/>

                        <h:outputText value="Biografija " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.zaposlen.cv}"/>

                        <h:outputText value="Datum isteka ugovora: " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.zaposlen.istekUgovora}"/>

                        <h:outputText value="Kabinet " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.zaposlen.kabinet}"/>

                        <h:outputText value="Konsultacije " style="font-weight:bold"/>
                        <p:inputText    value="#{adminDodajOsobu.zaposlen.prijem}"/>
                        
                        <h:outputText value="Status"/>
                        <p:selectOneMenu value="#{adminDodajOsobu.zaposlen.status}">
                            <f:selectItem itemValue="Aktivan" itemLabel="Aktivan"/>
                            <f:selectItem itemValue="Neaktivan" itemLabel="Neaktivan"/>
                        </p:selectOneMenu>

                        <h:outputText value="Zvanje: " style="font-weight:bold"/>            
                        <p:selectOneMenu value="#{adminDodajOsobu.zaposlen.zvanje}">
                            <f:selectItem itemValue="Redovni profesor" itemLabel="Redovni profesor"/>
                            <f:selectItem itemValue="Vandredni profesor" itemLabel="Vandredni profesor"/>
                            <f:selectItem itemValue="Docent" itemLabel="Docent"/>
                            <f:selectItem itemValue="Asistent" itemLabel="Asistent"/>
                            <f:selectItem itemValue="Saradnik u nastavi" itemLabel="Saradnik u nastavi"/>
                            <f:selectItem itemValue="Istrazivac" itemLabel="Istrazivac"/>
                            <f:selectItem itemValue="Laboratorijski inzinjer" itemLabel="Laboratorijski inzinjer"/>
                            <f:selectItem itemValue="Laboratorijski tehnicar" itemLabel="Laboratorijski tehnicar"/>                
                        </p:selectOneMenu>

                        <h:outputText value="Slika " style="font-weight:bold"/> 
                        <p:fileUpload fileUploadListener="#{adminDodajOsobu.uploadHandlerSlika}" mode="advanced" fileLimit="1" />


                        <p:commandButton value="Dodaj" ajax="false" actionListener="#{adminDodajOsobu.dodajZaposlenog}" />
                    </h:panelGrid>
                </h:form>

            </ui:define>
        </ui:composition>
    </body>
</html>
